package com.burstly.lib.util.json;

import com.burstly.lib.util.LoggerExt;
import com.burstly.lib.util.Utils;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class JsonProcessorFactory
{
  private static final Map<String, String> CONFIGURATION;
  private static final String JACKSON_CLASSPATH = "com.burstly.jackson.map.ObjectMapper";
  private static final String JSON_PROCESSOR_CLASSNAME_TEMPLATE = "com.burstly.lib.util.json.%@Processor";
  private static final LoggerExt LOG = LoggerExt.getInstance();
  private static final String TAG = "JsonProcessorFactory";
  private static IJsonProcessor sCurrentJsonProcessor;

  static
  {
    CONFIGURATION = new LinkedHashMap();
    CONFIGURATION.put("com.burstly.jackson.map.ObjectMapper", "Jackson");
  }

  public static IJsonProcessor getCurrentJsonProcessor()
  {
    try
    {
      IJsonProcessor localIJsonProcessor;
      if (sCurrentJsonProcessor != null)
      {
        localIJsonProcessor = sCurrentJsonProcessor;
        return localIJsonProcessor;
      }
      Iterator localIterator = CONFIGURATION.entrySet().iterator();
      while (true)
        while (true)
        {
          if (!localIterator.hasNext())
            break label162;
          Map.Entry localEntry = (Map.Entry)localIterator.next();
          boolean bool = Utils.isSdkAvailable((String)localEntry.getKey(), "JsonProcessorFactory");
          if (bool)
            try
            {
              sCurrentJsonProcessor = (IJsonProcessor)Class.forName("com.burstly.lib.util.json.%@Processor".replace("%@", (CharSequence)localEntry.getValue())).newInstance();
              LoggerExt localLoggerExt = LOG;
              Object[] arrayOfObject = new Object[1];
              arrayOfObject[0] = localEntry.getValue();
              localLoggerExt.logDebug("JsonProcessorFactory", "JSON Processor successfully instantiated for the {0} library", arrayOfObject);
              localIJsonProcessor = sCurrentJsonProcessor;
            }
            catch (Exception localException)
            {
              LOG.logThrowable("JsonProcessorFactory", localException);
            }
        }
    }
    finally
    {
    }
    label162: throw new RuntimeException("No JSON libraries available.");
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.util.json.JsonProcessorFactory
 * JD-Core Version:    0.6.2
 */